package com.twu.biblioteca;

/**
 * Created by shaunaks on 25/02/14.
 */
public class Book {

    private String isbn,name,author;


    public Book(String isbn,String name,String author)
    {
        this.isbn=isbn;
        this.name=name;
        this.author=author;

    }
    public Book()
    {

    }
    public String getIsbn()
    {
        return isbn;
    }
    public String getName()
    {
        return name;
    }

    public String getAuthor()
    {
        return author;
    }



    @Override
    public boolean equals(Object object)
    {
        boolean result = false;
        if (object == null || object.getClass() != getClass())
        {
            result = false;
        }
        else
        {
            Book book = (Book) object;
            if (this.isbn==book.isbn && this.name==book.name && this.author==book.author )
            {
                result = true;
            }
        }
        return result;
    }



    @Override
    public String toString()
    {
        return ("ISBN No: "+this.getIsbn()+" Book Name: "+this.getName()+" Book Author: "+this.getAuthor());

    }

//    public boolean equals(Book book)
//    {
//        if(this.isbn==book.isbn && this.name==book.name && this.author==book.author && this.borrower==book.borrower)
//            return true;
//        else
//            return false;
//    }
}
